unit CoordQryFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BaseFrm, ExtCtrls, StdCtrls, Buttons;

type
  TZUOBIAOInfo = record
   JINGDU: Single;
   WEIDU: Single;
  end;
  TFormCoordQry = class(TFormBase)
    GroupBox1: TGroupBox;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Label5: TLabel;
    Edit2: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure Edit2KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
    class function ShowCoordQryForm(var AZuobiaoInfo: TZUOBIAOInfo): Boolean;
  end;

var
  FormCoordQry: TFormCoordQry;

implementation

{$R *.dfm}

{ TFormCoordQry }

class function TFormCoordQry.ShowCoordQryForm(var AZuobiaoInfo: TZUOBIAOInfo): Boolean;
begin
  with TFormCoordQry.Create(nil) do
  try
     Result := (ShowModal = mrOk) and (Edit1.Text <> '') and (Edit2.Text <> '');
  finally
     AZuobiaoInfo.JINGDU := StrToFloatDef(Edit1.Text, 0);
     AZuobiaoInfo.WEIDU := StrToFloatDef(Edit2.Text, 0);
     Free;
  end;
end;

procedure TFormCoordQry.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  if not (Key in ['0'..'9', #8, '.', '-']) then
    Key := #0;
end;

end.
